<layout name='Layout/layout_main' />
<div class="home">
	<div class="row-fluid">
		<!-- 采购开始 -->
		<div class="tabbable span12 tab_box" sort="1">
			<div class="tab_head">
				<span>采购</span>
				<ul class="nav nav-tabs right" >
					<li class="active" >
						<a href="#tab1" data-toggle="tab" >最新</a>
					</li>
					<li>
						<a href="#tab2" data-toggle="tab">未读</a>
					</li>
				</ul>
			</div>
			<div class="tab-content">
				<div class="tab-pane active table" id="tab1">
					<ul>
						<volist name="new_mail_list" id="vo">
							<li>
								<span class="right hidden-phone">{$vo.create_time|toDate='m-d h:m'}</span>
								<span  class="auto autocut">
									<a href="{:U('mail/read?id='.$vo['id'])}" node="85" return_url="{:U('mail/mail_list?folder=inbox')}">{$vo.title}</a>
								</span>
							</li>
						</volist>
					</ul>
				</div>
				<div class="tab-pane table" id="tab2">
					<ul>
						<volist name="unread_mail_list" id="vo">
							<li>
								<span class="right hidden-phone">{$vo.create_time|toDate='m-d h:m'}</span>
								<span  class="auto autocut">
									<a href="{:U('process/read?id='.$vo['id'])}" node="87" return_url="{:U('process/process_list?folder=submit')}">{$vo.title}</a>
								</span>
							</li>
						</volist>
					</ul>
				</div>
			</div>
		</div>
		<!-- 采购结束 -->
	</div>
	<div class="row-fluid">
		<!-- 销售开始 -->
		<div class="tabbable span12 tab_box" sort="1">
			<div class="tab_head">
				<span>销售</span>
				<ul class="nav nav-tabs right" >
					<li class="active" >
						<a href="#tab1" data-toggle="tab" >最新</a>
					</li>
					<li>
						<a href="#tab2" data-toggle="tab">未读</a>
					</li>
				</ul>
			</div>
			<div class="tab-content">
				<div class="tab-pane active table" id="tab1">
					<ul>
						<volist name="new_mail_list" id="vo">
							<li>
								<span class="right hidden-phone">{$vo.create_time|toDate='m-d h:m'}</span>
								<span  class="auto autocut">
									<a href="{:U('mail/read?id='.$vo['id'])}" node="85" return_url="{:U('mail/mail_list?folder=inbox')}">{$vo.title}</a>
								</span>
							</li>
						</volist>
					</ul>
				</div>
				<div class="tab-pane table" id="tab2">
					<ul>
						<volist name="unread_mail_list" id="vo">
							<li>
								<span class="right hidden-phone">{$vo.create_time|toDate='m-d h:m'}</span>
								<span  class="auto autocut">
									<a href="{:U('process/read?id='.$vo['id'])}" node="87" return_url="{:U('process/process_list?folder=submit')}">{$vo.title}</a>
								</span>
							</li>
						</volist>
					</ul>
				</div>
			</div>
		</div>
		<!-- 销售结束 -->
	</div>
	<div class="row-fluid">
		<!-- 库存开始 -->
		<div class="tabbable span12 tab_box" sort="1">
			<div class="tab_head">
				<span>库存</span>
				<ul class="nav nav-tabs right" >
					<li class="active" >
						<a href="#tab1" data-toggle="tab" >最新</a>
					</li>
					<li>
						<a href="#tab2" data-toggle="tab">未读</a>
					</li>
				</ul>
			</div>
			<div class="tab-content">
				<div class="tab-pane active table" id="tab1">
					<ul>
						<volist name="new_mail_list" id="vo">
							<li>
								<span class="right hidden-phone">{$vo.create_time|toDate='m-d h:m'}</span>
								<span  class="auto autocut">
									<a href="{:U('mail/read?id='.$vo['id'])}" node="85" return_url="{:U('mail/mail_list?folder=inbox')}">{$vo.title}</a>
								</span>
							</li>
						</volist>
					</ul>
				</div>
				<div class="tab-pane table" id="tab2">
					<ul>
						<volist name="unread_mail_list" id="vo">
							<li>
								<span class="right hidden-phone">{$vo.create_time|toDate='m-d h:m'}</span>
								<span  class="auto autocut">
									<a href="{:U('process/read?id='.$vo['id'])}" node="87" return_url="{:U('process/process_list?folder=submit')}">{$vo.title}</a>
								</span>
							</li>
						</volist>
					</ul>
				</div>
			</div>
		</div>
		<!-- 库存开始 -->
	</div>
</div>	
	<link type="text/css" href="__PUBLIC__/css/jquery-ui.css" rel="stylesheet"/>
	<script type="text/javascript" src="__PUBLIC__/js/jquery-ui.min.js"></script>
	<script>
	$(function(){
			$(".home .row-fluid").sortable({
			cancel:".tab-content,.tab_head span,.tab_head ul.nav",
			 stop: function(event,ui){
				set_sort()
			 }
		});
			$( ".home .row-fluid").disableSelection();
			$( ".tab_head").disableSelection();
		init_sort("{$home_sort}");
		$(".home li a").click(function(){
			click_home_list($(this));
		})
	});	

	function init_sort(sort_string){
		array_sort=sort_string.split(",");
		for (x in array_sort)
		{
			index=array_sort[x];
			last=$(".tab_box:last");
			current=$(".tab_box[sort='"+index+"']");			
			if(index!==last.attr("sort")){
				current.insertAfter(last);
			}
		}
	};
	function set_sort(){
		var sort_string="";
		$(".tab_box").each(function(){
			sort_string=sort_string+$(this).attr("sort")+",";
		})
		sendAjax("{:U('set_sort')}","val="+sort_string);	
	}
	</script>